<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="../js/jquery-3.6.0.min.js" type="text/javascript"></script>

    <script type="text/javascript">

      $(function (){

        $("#filter").click(function (){

          // $("p:first").css("color","red");

          // $("p:last").css("color","red");

          // $("p:even").css("color","red");

          // $("p:odd").css("color","red");

          // $("p:eq(4)").css("color","red");

          // $("p:gt(2)").css("color","red");

          // $("p:lt(4)").css("color","red");

          // $("h1:header").css("color","red");

          // $("p:not(.p)").css("color","red");

        })
      })


    </script>
</head>
<body>


    <h1>一级标题</h1>
    <h2>二级标题</h2>
    <h3>三级标题</h3>

    <p>文本1</p>
    <p class="p">文本2</p>
    <p>文本3</p>
    <p>文本4</p>
    <span>span</span>
    <p class="p">文本5</p>
    <p>文本6</p>

    <input id="filter" type="button" value="基本过滤">

</body>
</html>